package controls;

import java.util.Observable;
import java.util.Observer;

import views.PanFunListarServico;
import views.WinFuncionario;

public class ControllerFunListarServico implements Observer{
	private PanFunListarServico pan_fun_listar_servico = new PanFunListarServico();
	private WinFuncionario winFuncionario;
	
	public void setPanel(WinFuncionario windowFuncionario){
		winFuncionario = windowFuncionario;
		
		pan_fun_listar_servico.criaPanel();
		pan_fun_listar_servico.addObserver(this);
		
		winFuncionario.setContent(pan_fun_listar_servico.getPanel());
	}
	@Override
	public void update(Observable arg0, Object arg1) {
		String temp = new String((String) arg1);
		int key_veic_id = Integer.parseInt(temp);
		pan_fun_listar_servico.setVeic(ControllerLogin.getPersistence().list("ServicoTree", key_veic_id));
	}
	
}
